package com.ny.zmb.openapi.config;

import lombok.Data;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import java.io.File;
import java.io.IOException;

/**
 * createAuthor : Xmw
 * createTime : 2024-9-3 17:23
 */

@Data
public class YsConfig {

    private String ysPublicCerPath;
    private String mercPrivateFile;

    public YsConfig(){
        this.ysPublicCerPath = "sm2/sm2businessgate.cer";
        this.mercPrivateFile = "sm2/1.sm2";
    }
//    public YsConfig() {
//        try {
//            File file = new ClassPathResource("sm2/sm2businessgate.cer").getFile();
//            File file2 = new ClassPathResource("sm2/1.sm2").getFile();
//            this.ysPublicCerPath = file.getPath();
//            this.mercPrivateFile = file2.getPath();
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }
//    }

//    private String ysPublicCerPath = "/root/java/web/sm2/sm2businessgate.cer";
//    private String mercPrivateFile = "/root/java/web/sm2/1.sm2";

}
